<template>
  <button
    class="set-button"
    :class="{
      active: isActive,
      'has-panels': hasPanels,
    }"
    @click="$emit('click', setNumber)"
    data-tauri-drag-region="false"
  >
    {{ setNumber }}
    <span v-if="hasPanels" class="panel-indicator">●</span>
  </button>
</template>

<script setup lang="ts">
interface Props {
  setNumber: number;
  isActive: boolean;
  hasPanels: boolean;
}

defineProps<Props>();

defineEmits<{
  click: [setNumber: number];
}>();
</script>

<style scoped>
.set-button {
  width: 16px;
  height: 16px;
  border: 1px solid #fff;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: bold;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-weight: bold;
}

.set-button:hover {
  background: rgba(255, 255, 255, 0.3);
}

.set-button.active {
  background: rgba(255, 255, 255, 0.8);
  color: #333;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.set-button.has-panels {
  border-color: #4caf50;
  background: rgba(76, 175, 80, 0.3);
}

.set-button.has-panels:hover {
  background: rgba(76, 175, 80, 0.4);
}

.panel-indicator {
  position: absolute;
  top: -2px;
  right: -2px;
  font-size: 8px;
  color: #4caf50;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}
</style>
